<?php
  require("abifunktsioonid.php");
  if(isSet($_REQUEST["sort"])){
     $ained=kysiAineteAndmed($_REQUEST["sort"]);
  } else {
     $ained=kysiAineteAndmed();
  }
?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
  <head>
      <title>Hinnete leht</title>
      <meta http-equiv="Content-Type" content="text/html;charset=utf-8" />
  </head>
  <body>    
     <table>
       <tr>
         <th><a href="opilane.php?sort=grupinimi">Grupinimi</a></th>
         <th><a href="opilane.php?sort=opetajanimi">Opetaja</a></th>
         <th><a href="opilane.php?sort=hinne">Hinne</a></th>
		 <th><a href="opilane.php?sort=tookirjeldus">Tookirjeldus</a></th>
       </tr>
       <?php foreach($ained as $aine): ?>
         <tr>
           <td><?=$aine->grupinimi ?></td>
           <td><?=$aine->opetajanimi ?></td>
           <td><?=$aine->hinne ?></td>
		   <td><?=$aine->tookirjeldus ?></td>
         </tr>
       <?php endforeach; ?>
     </table>
  </body>
</html>

